j(document).ready(function(){

		

		j('#txtName,#txtEmail,#txtMsg').click(function(){

			j(this).addClass('greenBox')

		});

		

		// for Name field...

		j('#txtName').blur(function(){

			j(this).removeClass('greenBox');

				if(!j(this).isEmpty()) 

				{

					j(this)

						.removeClass('input-error')

				}

				else

				{

					j(this)

						.addClass('input-error')

						.val("Your Name");

				}

		});



		// for Email-ID field...

		j('#txtEmail').blur(function(){

			j(this).removeClass('greenBox');

			 if(!j(this).isEmpty()) {

				 if(j(this).emailCheck()) {

					j(this)

						.removeClass('input-error')

				}

				else

				{

					j(this)

						.addClass('input-error')

				}



			}

			else

			{

				j(this)

					.addClass('input-error')

					.val("Your E-mail Address");

			}

		});





		// for Message box...

		j('#txtMsg').blur(function(){

			j(this).removeClass('greenBox');

			 if(!j(this).isEmpty()) {

				j(this)

					.removeClass('t-error')

			}

			else

			{

				j(this)

					.addClass('t-error')

					.val("Put your message here");

			}

		});

	

	

		// on button-click event...

		j('#btnSend').click(function(){

			

			j('.request').removeClass('errorBox');

			var msgArr = new Array();

			

				//if (j('#txtName').val()=='' || j('#txtName').val()=='Your Name' || j('#txtName').val()=='Your Name')
				if (j('#txtName').val()=='' || j('#txtName').val()=='Your Name')
				{

					j('#txtName').addClass('input-error')

					.val("Your Name");

					msgArr.push(j(this).attr('title'));

				}

				





				//if (j('#txtEmail').val()=='' || j('#txtEmail').val()=='Your E-mail Address' || j('#txtEmail').val()=='Your E-mail Address')
				if (j('#txtEmail').val()=='' || j('#txtEmail').val()=='Your E-mail Address')
				{

					j('#txtEmail').addClass('input-error')

					.val("Your E-mail Address");

					msgArr.push(j(this).attr('title'));

				}

				else

				{

					if(	!j('#txtEmail').emailCheck() )

					{

						j('#txtEmail').addClass('input-error');
						msgArr.push(j(this).attr('title'));

					}

				}





				if (j('#txtMsg').val()=='' || j('#txtMsg').val()=='Put your message here')

				{

					j('#txtMsg').addClass('t-error')

					.val("Put your message here");

					msgArr.push(j(this).attr('title'));

				}





				

		

		//msgArr.length=0;

		//alert(msgArr.length);

		
		if (msgArr.length == 0)

		{

			var params = {

				'module': 'contact',

				'action': 'sendContactData'

			};

			var paramsObj = j('#frmQContact').serializeArray();

			j.each(paramsObj, function(i, field){

				params[field.name] = field.value;

			});

			j.ajax({

				type: "POST",

				url: 'ajax/quick_contact_process.php',

				data: params,

				dataType: 'json',
				
				success: function(data){
				
					if (data.flag == 1)

					{

						j('#qcontact_msg').show();	

						document.frmQContact.reset()

					}

				}

		});

			

		}

		else

		{

			j('#idd')

				.html(msgArr.join('<br>'))

				.fadeOut(1000)

				.fadeIn(1000);

		

			alert(msgArr.join('\n'));

		}

			

			

			

			// checkError('contactForm')			

		return false;

	});

	



});